import hashlib
import time
import simplejson as json


def result(code=200, d={}):
    data = dict()
    data['code'] = code
    data['data'] = d
    return json.dumps(data, ensure_ascii=False)


def md5(m, salt):
    _str = m + salt
    return hashlib.md5(_str.encode()).hexdigest()


def get_now_data_time():
    return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())


def get_time_stamp():
    return time.time()


def get_order_num():
    order_num = str(get_time_stamp()).replace('.', '')
    return order_num
